USERNAME = group14
ASSIGNMENT = 02
SERVER = 138.232.64.210
PORT = 22113
FILES = RSA.?pp assignment02.txt

CXXFLAGS += -O0 -Wall -g
LDFLAGS += -lgmp

BINS = RSATest

SRCS = Block.cpp GenericException.cpp Integer.cpp Message.cpp RSA.cpp RSATest.cpp Statics.cpp
HDRS = Algorithm.hpp Block.hpp GenericException.hpp Integer.hpp Message.hpp RSA.hpp
OBJS = Block.o GenericException.o Integer.o Message.o RSA.o Statics.o

DEPSFILE = .depend

.PHONY: upload sense clean

all: $(BINS)

upload:
	touch check
	scp -P $(PORT) check $(FILES) $(USERNAME)@$(SERVER):assignment$(ASSIGNMENT)

sense:
	scp -P $(PORT) $(USERNAME)@$(SERVER):log.txt $(USERNAME)@$(SERVER):compile.log .
	tail compile.log log.txt

clean:
	rm -f $(BINS) $(OBJS) $(DEPSFILE) check log.txt compile.log

$(BINS): %: %.cpp $(HDRS) $(OBJS) $(DEPSFILE)
	$(CXX) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(OBJS)

$(DEPSFILE): $(SRCS)
	$(CXX) -MM $(SRCS) > $(DEPSFILE)

-include $(DEPSFILE)
